<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
		<style>
			*{
				font-size: 12px;
			}
			span{
				display: inline-block;
				width: 33px;
			}
			td{
				width: 10px;
			}
		</style>
	<body>
		<script>
			for ( var i = 1; i < 6; i++ ){
				for( var j = 1; j <= i; j++ ){
					document.write('*');
				}
				document.write('<br>');
			}
			
			for ( var r = 1; r < 6; r++ ) {
				for( var b = 4; b >= r; b-- ) {
					document.write('<span></span>');
				}
				for( var c = 1; c <= r; c++ ){
					document.write('<span>*</span>');
				}
				document.write('<br>');
			}
			
			
//				【提高题】代码输出以下字符
//				    *				
//				   * *				
//				  *   *				
//				 *     *				
//				*********				
//			**************************************************************
			document.write('<br>');	
//			for ( var a = 1; a <= 9; a++ ) {
//				for( var d = 4; d >= a; d-- ) {
//					document.write('<span></span>');
//				}
//				for( var c = 1; c <= a; c++ ) {
//					document.write('<span>*</span>');
//				}
//				for( var e = 4; e >= a; e-- ) {
//					document.write('<span></span>');
//				}
//				document.write('<br>');	
//			}

			for (var n = 0; n < 100; n++ ){
				if ((n%2)!==0){
					console.log(n);
				}
			}

			var sum = 0;
			var fz = 2, fm =1;
			for ( var r = 1; r <= 19; r++ ){
				f_z = fz + fm;
				f_m = fz;
						
				sum+=(f_z/f_m);
				
				fz = f_z;
				fm = f_m;
			}
			sum += (2/1);
			console.log(sum);
			
			
			var last_m = 100;
			var first_m = 33000;
			var timer = 0 ;
			while( first_m > last_m ){
				if (first_m > 30000){
					first_m = first_m - 3000;
					timer++;
				}
				
				if ( first_m <= 30000 ){
					first_m = first_m * 0.9;
					timer++;
				}
			}
			
			console.log(timer);
			
			
			var bj = 1000;
			var ls = 0;
			var mn = 0;
			for ( var t = 1 ; t <= 30; t++ ){
				ls = ( bj * 0.01 );
				mn = bj + ls;
				bj = mn;
			}
			
			console.log(bj);
				/***********************************
				6.小明题目升级版，小明拿着1000块在周一买入基金，一开户立给10块红利，
				逢周六日没有利息，平时利息为1%，请问30天后，小明可以拿回多少钱？
			***********************************/
			var mon = 1010;
	
			for ( var day = 1 ; day <= 22; day++ ) {
				mon = ( mon * 1.01 );
			}
			
			console.log(mon);
			
			//let 在其所在的代码块 才能访问到。
			
			//定义k=0 作用域在for( )
			for (let k = 0; k < 3; k++ ){
				//定义k=123,作用域在 {  }里
				let k = 123;
				console.log()
			}
		</script>
	</body>
</html>
